<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>代销结算设置</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/jquery.validate.min.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/jquery.metadata.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/messages_cn.js" type="text/javascript"></script>
<script src="${BasePath}/res/js/common/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<script src="${BasePath}/res/js/common/jquery.validate.method.js" type="text/javascript"></script>
<script src="${Plugins}/datepicker/WdatePicker.js" type="text/javascript"></script>
<style type="text/css">
    body{ font-size:12px;}
    .l-table-edit {}
    .l-table-edit-td{ padding:4px;}
    .l-button-submit,.l-button-test{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
    .l-verify-tip{ left:230px; top:120px;}
    .p-tab .s-lab{font-size:12px;font-family:"微软雅黑",​"宋体",​Arial,​sans-serif;}
	input.l-textarea{width:170px;height:20px;font-size:12px;}
	 .navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
</style>
</head>
<body style="padding:10px">
<div class="navbar">
		<span>您当前的位置：</span>
		基础数据管理 &gt; 供应商管理&gt;购销结算设置 
</div>
<form name="form1" method="post" action="setAccountsBySell.do" id="form1">
<br>
<div id="sellByGou">
<table cellpadding="0" cellspacing="0" class="l-table-edit p-tab" >
<input name="accountsType" id="accountsType"  type="hidden" value="1">
    <input name="code" id="code"  type="hidden" value="${code}">
     <tr>
        <td align="right" class="l-table-edit-td s-lab">结算周期（每月）:</td>
        <td align="left" class="l-table-edit-td s-lab"> 
         <select id="accountsTime" name="accountsTime" width="30%" class="l-textarea"  validate="{required:true}" title="请设置结算日期">
         <option value="">请选择</option>
         <option value="1" <c:if test="${SupplierAccounts.accountsTime=='1'}">selected</c:if>>1</option>
         <option value="2" <c:if test="${SupplierAccounts.accountsTime=='2'}">selected</c:if>>2</option>
         <option value="3" <c:if test="${SupplierAccounts.accountsTime=='3'}">selected</c:if>>3</option>
         <option value="4" <c:if test="${SupplierAccounts.accountsTime=='4'}">selected</c:if>>4</option>
         <option value="5" <c:if test="${SupplierAccounts.accountsTime=='5'}">selected</c:if>>5</option>
         <option value="6" <c:if test="${SupplierAccounts.accountsTime=='6'}">selected</c:if>>6</option>
         <option value="7" <c:if test="${SupplierAccounts.accountsTime=='7'}">selected</c:if>>7</option>
         <option value="8" <c:if test="${SupplierAccounts.accountsTime=='8'}">selected</c:if>>8</option>
         <option value="9" <c:if test="${SupplierAccounts.accountsTime=='9'}">selected</c:if>>9</option>
         <option value="10" <c:if test="${SupplierAccounts.accountsTime=='10'}">selected</c:if>>10</option>
         <option value="11" <c:if test="${SupplierAccounts.accountsTime=='11'}">selected</c:if>>11</option>
         <option value="12" <c:if test="${SupplierAccounts.accountsTime=='12'}">selected</c:if>>12</option>
         <option value="13" <c:if test="${SupplierAccounts.accountsTime=='13'}">selected</c:if>>13</option>
         <option value="14" <c:if test="${SupplierAccounts.accountsTime=='14'}">selected</c:if>>14</option>
         <option value="15" <c:if test="${SupplierAccounts.accountsTime=='15'}">selected</c:if>>15</option>
         <option value="16" <c:if test="${SupplierAccounts.accountsTime=='16'}">selected</c:if>>16</option>
         <option value="17" <c:if test="${SupplierAccounts.accountsTime=='17'}">selected</c:if>>17</option>
         <option value="18" <c:if test="${SupplierAccounts.accountsTime=='18'}">selected</c:if>>18</option>
         <option value="19" <c:if test="${SupplierAccounts.accountsTime=='19'}">selected</c:if>>19</option>
         <option value="20" <c:if test="${SupplierAccounts.accountsTime=='20'}">selected</c:if>>20</option>
         <option value="21" <c:if test="${SupplierAccounts.accountsTime=='21'}">selected</c:if>>21</option>
         <option value="22" <c:if test="${SupplierAccounts.accountsTime=='22'}">selected</c:if>>22</option>
         <option value="23" <c:if test="${SupplierAccounts.accountsTime=='23'}">selected</c:if>>23</option>
         <option value="24" <c:if test="${SupplierAccounts.accountsTime=='24'}">selected</c:if>>24</option>
         <option value="25" <c:if test="${SupplierAccounts.accountsTime=='25'}">selected</c:if>>25</option>
         <option value="26" <c:if test="${SupplierAccounts.accountsTime=='26'}">selected</c:if>>26</option>
         <option value="27" <c:if test="${SupplierAccounts.accountsTime=='27'}">selected</c:if>>27</option>
         <option value="28" <c:if test="${SupplierAccounts.accountsTime=='28'}">selected</c:if>>28</option>
         <option value="29" <c:if test="${SupplierAccounts.accountsTime=='29'}">selected</c:if>>29</option>
         <option value="30" <c:if test="${SupplierAccounts.accountsTime=='30'}">selected</c:if>>30</option>
         <option value="31" <c:if test="${SupplierAccounts.accountsTime=='31'}">selected</c:if>>31</option>
        </select>
       日
       </td><td align="left"></td>
    </tr>
</table>
</div>

<input type="submit" value="保存" id="Button1" class="l-button l-button-submit" /> 
<input type="button" value="取消" name="tests"  id="tests" onclick="javascript:closeList()" class="l-button l-button-test" />
</form>
<div style="display:none">
<!--  数据统计代码 --></div>

<script type="text/javascript">
$(function ()
		{
			//validate
		    $.metadata.setType("attr", "validate");
		    var v = $("form").validate({
		        errorPlacement: function (lable, element)
		        {
		        	lable.ligerHideTip();
		            if (element.hasClass("l-textarea"))
		            {
		                element.ligerTip({ content: lable.html(), target: element[0] }); 
		            }
		            else if (element.hasClass("l-text-field"))
		            {
		                element.parent().ligerTip({ content: lable.html(), target: element[0] });
		            }
		            else
		            {
		                lable.appendTo(element.parents("td:first").next("td"));
		            }
		        }
		    ,
		        success: function (lable)
		        {
		            lable.ligerHideTip();
		            lable.remove();
		        },
		        submitHandler:function()
		        {
		            $("form .l-text,.l-textarea").ligerHideTip();
		            var options = {
		            		type: 'POST',
		            		beforeSend: function(){
		            			$("#form1").find(":submit,:button").attr("disabled", true);
		            		},
		            		success: function(data){
		            			if(data=="success") {
		            				var s=window.parent.$.ligerDialog.success("设置成功","提示",function () {
		            	        		parent.window.location.href = '../../base/supplierInfo/pageFinderSupplier.do';
		            	        		});
		            	        		$(s.dialog.winbtns).remove();
		            	        		} else {
		            	        		  window.parent.$.ligerDialog.error("设置失败");
		            	        		}
		            	      	}	
		            	}, $form1 = $("#form1");
		           $form1.ajaxSubmit(options);
		             return false;
		        }
		    });
		}); 
// 取消
function closeList(){
	parent.window.location.href = '../../base/supplierInfo/pageFinderSupplier.do';
 }
</script>
</body>
</html>